<div class="adtb medium-12 column" style="padding:0;">
<table class="" cellspacing='0' style="width:100%;">
	<thead>
		<tr>
			<th><?=AdminAccount::find()->count()?> Admins</th>
			<th>Actions</th>
			<th>Last logged in</th>
			<th class="text-center">Action</th>
		</tr>
	</thead>
    
	<tbody>
		<?php foreach (AdminAccount::find(array("conditions"=>"id != ?0","bind"=>array(0=>$this->session->get('admin_id')))) as $value) { 
			$actions = array();
			if($value->approve == "on")
			{
				$actions[] = "Approve";
			}
			if($value->delete == "on")
			{
				$actions[] = "Delete";
			}
			if($value->update == "on")
			{
				$actions[] = "Update";
			}
			if($value->add == "on")
			{
				$actions[] = "Add";
			}
			if($value->modify == "on")
			{
				$actions[] = "Modify Account";
			}
			$action = implode('-', $actions);
			$last_login = new DateTime($value->last_login,new DateTimeZone('Asia/Hong_Kong'));
			$last_login = $last_login->format('l F d , Y h:i:s A');	
		?>
		<tr>
			<td><a class="link" data-reveal-id="edituseradmin"><?=$value->fullname?></a></td>
			<td><?=$action?><a href="#" data-reveal-id="editaction" aid="<?=$value->id?>" actions="<?=implode(',',$actions)?>" class="btnEditAccount">[edit]</a></td>
			<td><?=$last_login?></td>
			<td class="text-center">
				<?php if($value->status == 0){ ?>
				<a class="btnReactivateAccount" aid="<?=$value->id?>"  class="tiny radius button" style="padding:0.2rem;margin:0;">Reactivate</a>
				<?php }else if($value->status == 1) { ?>
                <a class="btnDeactivateAccount" aid="<?=$value->id?>"  class="tiny alert radius button" style="padding:0.2rem;margin:0;">Deactivate</a>
                <?php } ?>
            </td>
		</tr>
		<?php } ?>
	</tbody>
</table>

</div>